import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getwidget/getwidget.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/route/route.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';
import 'package:meal/utils/tools.dart';

class EvaluateReply extends StatefulWidget {
  const EvaluateReply({Key? key}) : super(key: key);

  @override
  State<EvaluateReply> createState() => _EvaluateReplyState();
}

class _EvaluateReplyState extends State<EvaluateReply> {
  String content = '';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ToolsUtils.getDefaultBackgroundColor(),
      appBar: ToolsUtils.getDefaultBrnAppBar('回复评价'),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              margin: const EdgeInsets.only(top: Sizes.default20),
              padding: const EdgeInsets.all(Sizes.default10),
              decoration: const BoxDecoration(color: Colors.white),
              child: BrnInputText(
                minHeight: 200,
                minLines: 4,
                maxLength: 200,
                bgColor: ColorsUtils.rgba(247, 247, 247, 1),
                padding: const EdgeInsets.all(Sizes.default10),
                borderRadius: Sizes.default10,
                hint: '有什么想对顾客说的？',
                onTextChange: (String text) {
                  setState(() {
                    content = text;
                  });
                },
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default20),
              decoration: const BoxDecoration(
                color: Colors.white,
              ),
              padding: const EdgeInsets.all(Sizes.default15),
              child: ListBody(
                children: [
                  Container(
                    height: Sizes.default50,
                    margin: const EdgeInsets.only(bottom: Sizes.default10),
                    child: Row(
                      children: [
                        Text.rich(TextSpan(
                            text: '默认回复',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color333, fontSize: Sizes.default15),
                            children: [
                              TextSpan(
                                  text: '(点击文本使用)',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default12))
                            ])),
                        TextButton(
                            onPressed: () {
                              Get.toNamed(RouteGet.evaluateEditReply);
                            },
                            child: Text(
                              '点击',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color006, fontSize: Sizes.default13),
                            ))
                      ],
                    ),
                  ),
                  Container(
                    padding: const EdgeInsets.all(Sizes.default10),
                    decoration: BoxDecoration(color: ColorsUtils.rgba(250, 250, 250, 1)),
                    child: Text(
                      '亲爱的顾客，感谢您认可我们的口味和服务，我们会努力做得更好，祝您生活愉快！',
                      style:
                          StylesUtils.customTextStyle(color: ColorsUtils.color333, lineHeight: 1.8),
                    ),
                  )
                ],
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default20),
              height: Sizes.default50,
              child: FractionallySizedBox(
                widthFactor: 0.8,
                heightFactor: 0.9,
                child: GFButton(
                    onPressed: () {},
                    text: '提交',
                    textStyle: StylesUtils.customTextStyle(fontSize: Sizes.default16),
                    shape: GFButtonShape.pills,
                    type: GFButtonType.solid,
                    size: GFSize.LARGE,
                    color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorFf6)),
              ),
            )
          ],
        ),
      ),
    );
  }
}
